import request from '@/utils/request'

// 查询企业的部门列表
export function getDepts() {
  return request({
    url: '/company/department'
  })
}

// 新增部门接口
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 根据ID查询部门详情
export function getDeptDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 根据id修改部门详情
export function editDept(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 根据ID删除部门
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
